<?php
class BasicType extends AppModel
{
  var $name = 'BasicType';
  var $useTable = "basic_types";
  var $id = "bt_id";
  var $primaryKey = "bt_id";

  function get_basic_types()
  {
		$rows = $this->findAll(null, "bt_id, bt_name", "bt_name", null, 1, null);
		return $rows;
	}

	function getFieldValue($field, $key, $key_value)
	{
		$rows = $this->field($field, array("$key" => "$key_value"));
		return $rows;
  }

  function getFieldsValue($whereArray, $fields)
  {
		$rows = $this->find($whereArray, $fields, null, null);
		return $rows;
  }

  function setPrimaryKey ($key)
  {
    $this->primaryKey = $key;
  }

  function getListBasicTypes()
  {
    return $this->generateList(null, "bt_name", null, "{n}.BasicType.bt_id", "{n}.BasicType.bt_name");
  }
}
?>
